home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor2 / goto.doc < prev    next >
Text File  |  1995-03-31  |  1KB  |  36 lines

  1. úÄÄÄÄÄÄ¿ 
  2. 3 GOTO 3  by Joseph K. Horn, permanently brain damaged by BASIC. 
  3. àÄÄÄÄÄÄù 
  4.  
  5. So you want to jump into the middle of a System RPL routine, but the 
  6. Laws of RPL told you that it's impossible?  It can be done! 
  7.  
  8. System RPL has a GOTO in it!  HP's documentation didn't explain how it 
  9. works, but it's simple: 
  10.  
  11.     GOTO (foo), where (foo) is a five-nibble address (NOT a system 
  12.     binary!) jumps immediately to address (foo), where RPL continues. 
  13.  
  14. This allows us to jump smack into the middle of any operating system 
  15. RPL program!  However, (foo) must NOT be a program prolog.  There are 
  16. supported means for jumping to supported objects.  GOTO is intended 
  17. ONLY for jumping into the *middle* of objects. 
  18.  
  19. Don't worry; it can't result in spaghetti code, because it only works 
  20. on fixed addresses, so you can't use it to jump around within the 
  21. running program itself. 
  22.  
  23. There are also two conditional versions: ?GOTO jumps if TRUE is on 
  24. level one; NOT?GOTO jumps if FALSE is on the stack.  Both remove the 
  25. flag before jumping.  Neither returns; it's not a GOSUB.  These occur 
  26. in the HP 48 operating system more than 200 times, so don't worry that 
  27. it isn't the way HP would write software... 
  28.  
  29. The magic addresses: 
  30.  
  31. 619CB  GOTO      jump to subsequent 5-nibble absolute address 
  32. 619E0  ?GOTO     if TRUE then DROP GOTO else DROP 
  33. 619F3  NOT?GOTO  if FALSE then DROP GOTO else DROP 
  34.  
  35. -jkh-   EQU   akcs.joehorn@hpcvbbs.cv.hp.com 
  36.